/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.knowledge;

import co.edu.unal.bioingenium.kbmed.config.Configuration;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Alejandro Riveros Cruz
 */
public abstract class KnowledgeSourceMetaData {

    private static KnowledgeSourceMetaData knowledgeSourceMetaDataInstance = null;

    

    /**
     * 
     * @return
     */
    public static KnowledgeSourceMetaData getReference() {
        if (knowledgeSourceMetaDataInstance == null) {
            try {
                knowledgeSourceMetaDataInstance = (KnowledgeSourceMetaData) Class.forName(Configuration.KNOWLEDGE_SOURCE_METADATA_CLASS_NAME).newInstance();
            } catch (InstantiationException ex) {
                Logger.getLogger(KnowledgeSourceMetaData.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                Logger.getLogger(KnowledgeSourceMetaData.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(KnowledgeSourceMetaData.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return knowledgeSourceMetaDataInstance;
    }

    /**
     * 
     * @param knowledgeSourceMetaData
     */
    public static void setKnowledgeSourceMetaDataProvider(KnowledgeSourceMetaData knowledgeSourceMetaData) {
        Logger.getLogger(knowledgeSourceMetaData.getName()).log(Level.WARNING, "KnowledgeSource Metadata changed after initialziation");
        knowledgeSourceMetaDataInstance = knowledgeSourceMetaData;
    }

    /**
     * 
     * @return
     */
    public abstract String getIdentifier();

    /**
     * 
     * @return
     */
    public abstract Class getDAOClass();

    /**
     * 
     * @return
     */
    public abstract String getName();

    /**
     * 
     * @return
     */
    public abstract String getTopConceptId();

    /**
     * 
     * @return
     */
    public abstract String getISARelationship();
}
